<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<style type="text/css">
.float_left{
	float:left;
}
.float_right{
	float:right;
}
.clear{
	clear:both;
}
.padding5{
	padding:5px;
}
.padding_top4{
	padding-top:4px;
}
/*分页样式*/
.paging{}
.paging span{
	display:block;
	float:left;
	margin:0 0 0 5px;
	font-family: Arial;
	padding:0!important;
}
.paging a{
	padding:0 6px 0 6px!important;
	border:solid 1px #cccccc;
	background-color:#edf7f9;
	height:19px;
	line-height:19px;
}
.paging a:hover{
	color:white;
	text-decoration:none;
	background-color:#3366cc;
	border:solid 1px #193d84;
}
.paging_disabled a{
	color:#cccccc!important;
	cursor:default!important;
}
.paging_disabled a:hover{
	color:#cccccc!important;
	background-color:#edf7f9!important;
	border:solid 1px #cccccc!important;
}
.paging_current a{
	color:white!important;
	cursor:default!important;
	background-color:#3366cc!important;
	border:solid 1px #193d84!important;
}
 /*分页样式*/
</style> 
<div class="float_left paging">
	<div class="float_left padding_top4">
		<c:choose>
			<c:when test="${page.totalRow == 0}">
				<span>无记录</span>
				<input type="hidden" maxLength="8" style="width:30px" value="1" id="pageNumber"/>	
				<input type="hidden" value="1" id="pageTotal"/>	
			</c:when>
			<c:otherwise>
			<span>共${page.totalRow}条记录</span>
			<span>每页</span>
					<div class="float_left">
						<input type="text" maxLength="8" style="width:30px" value="${page.pageSize}" id="pageLimit" name="limit"/>
					</div>
			<span>条记录</span>
		
	 		<c:if test="${page.pageNumber==1}">
					<span class="paging_disabled"><a href="javascript:;">首页</a>
					</span>
					<span class="paging_disabled"><a href="javascript:;">上页</a>
					</span>
			</c:if>
			<c:if test="${page.pageNumber>1}">
					<span><a href="javascript:jumpTo(1);">首页</a>
					</span>
					<span><a href="javascript:jumpTo(${page.pageNumber}-1);">上页</a>
					</span>
			</c:if>
			<c:if test="${page.pageNumber==page.totalPage}">
					<span class="paging_disabled"><a href="javascript:;">下页</a>
					</span>
					<span class="paging_disabled"><a href="javascript:;">尾页</a>
					</span>
			</c:if>
			<c:if test="${page.pageNumber<page.totalPage}">
					<span><a href="javascript:jumpTo(${page.pageNumber}+1);">&nbsp;下页</a>
					</span>
					<span><a href="javascript:jumpTo(${page.totalPage});">尾页</a>
					</span>
			</c:if>
					<span>				
						<input type="text" maxLength="8" style="width:30px" value="${page.pageNumber}" id="pageNumber"/>	
						<input type="hidden" value="${page.totalPage}" id="pageTotal"/>	
					</span>			
					<span>/${page.totalPage}页</span><span><a href="javascript:jumpToPage();">跳转</a></span>	
			</c:otherwise>
		</c:choose>
	</div>
</div>
<div class="clear"></div>
<script>
	var action = "${contextPath}/post/queryPage";

	function jumpToPage(){
		var pageNo = $("#pageNumber").val();
		var pageLi = $("#pageLimit").val()||10;
		if(pageNo==null||pageNo==""||pageNo==undefined||pageNo=="0")
			pageNo=1;
		if(pageNo>${page.totalPage})
			pageNo=${page.totalPage};
		var frm = $("#queryForm_${timer }");
		var url = action+"/"+pageNo+"-"+pageLi;	
		frm.attr("action",url+".jhtml");
		frm.target='_self';
		$("#queryForm_${timer }").submit();
	}
	
	function jumpTo(pageNo){
		var pageLi = $("#pageLimit").val()||10;
		if(pageNo==null||pageNo==""||pageNo==undefined||pageNo=="0")
			pageNo=1;
		if(pageNo>${page.totalPage})
			pageNo=${page.totalPage};
		var frm = $("#queryForm_${timer }");	
		var url = action+"/"+pageNo+"-"+pageLi;	
		frm.attr("action",url+".jhtml");
		frm.target='_self';
		$("#queryForm_${timer }").submit();
	}
	
	function onSouSuo(){
		var frm = $("#queryForm_${timer }");	
		var url = action;	
		frm.attr("action",url+".jhtml");
		frm.target='_self';
		$("#queryForm_${timer }").submit();
	}
</script>
